import localforage from 'localforage'

class LocalforageCache {
  set(key: string, value: any) {
    return localforage.setItem(key, value)
  }

  get(key: string) {
    return localforage.getItem(key)
  }

  remove(key: string) {
    return localforage.removeItem(key)
  }

  clear() {
    return localforage.clear()
  }

  length() {
    return localforage.length()
  }

  key(index: number) {
    return localforage.key(index)
  }

  keys() {
    return localforage.keys()
  }
}

export default new LocalforageCache()